<template>
	<view class="lunbo">
		<swiper :autoplay="true" :interval="3000" :duration="1000">
			<swiper-item v-for="v in imageSrc">
				<image :src="v" mode="aspectFit"></image>
			</swiper-item>
		</swiper>
	</view>
	<view class="deta">
		<view class="detaName" v-for="(v,i) in GrounpDeta" :key='i'>
			<view>
				<text>团课</text>
				<text>{{v.courseName}}</text>
			</view>
			<view>
				<view>
					<view>
						<text>￥</text>
						<text>{{v.classmoney}}元/次</text>
					</view>
					<view>
						<text>￥120.00</text>
					</view>
				</view>
				<view>
					<text>{{v.classintro}}</text>
				</view>
			</view>
		</view>
	</view>
	<view class="changgeType">
		<view @click="details" :class="index==1?'border_bot':''">详情</view>
		<view @click="card" :class="index==2?'border_bot':''">支持会员卡</view>
		<view @click="comments" :class="index==3?'border_bot':''">评论</view>
	</view>
	<detail v-show="index==1?true:false"></detail>
	<cars v-show="index==2?true:false"></cars>
	<comments v-show="index==3?true:false"></comments>
	<view class="footer">
		<view>
			<view>
				<view class="iconfont icon-dianhua"></view>
				<view>联系教练</view>
			</view>
			<view @click="share_coure">
				<view class="iconfont icon-fenxiang"></view>
				<view>分享课程</view>
			</view>
		</view>

		<view>
			<button type="default" @click="GrounpTrue()">
				立即预课
			</button>
		</view>
	</view>
</template>

<script>
	import myRequest from '../../../utils/myRequest.js'
	import cars from './cars.vue'
	import detail from './details.vue'
	import comments from './comments.vue'
	import store from '../../../store/index.js'
	export default {
		data() {
			return {
				index: 1,
				myid: '',
				imageSrc: [

				],
				GrounpDeta: [{
					// GrounpName:'极速减脂训练课程火热预约',
					// //现价
					// GrounpMoney:'20.00',
					// GrounpTable:'极速减脂',
				}],
			}
		},
		methods: {
			//页面组件的跳转
			details: function() {
				this.index = 1

			},
			card: function() {
				this.index = 2
			},
			comments: function() {
				this.index = 3
			},
			GrounpTrue: function() {
				uni.navigateTo({
					url: 'GrounpTrue'
				})
			},
			getData() {
				this.GrounpDeta = [];
				let myArry = this.$store.state.Group.GroupArr;
				this.GrounpDeta.push(myArry)
				this.imageSrc = JSON.parse(myArry.Grounpimage)
			},
		},
		mounted() {
		this.getData()
		},
		components: {
			cars,
			comments,
			detail
		},
	}
</script>

<style>
	@import url('~@/static/font-li/font2022/iconfont.css');

	.lunbo image {
		width: 750rpx;
	}

	.deta {
		padding: 20rpx;
	}

	.detaName>view:first-child {
		margin-bottom: 20rpx;
	}

	.detaName>view:first-child text:first-child {
		display: inline-block;
		background: #FEC400;
		width: 100rpx;
		height: 50rpx;
		text-align: center;
		line-height: 50rpx;
		border-radius: 10rpx;
		color: #FFFFFF;
		margin-right: 20rpx;
	}

	.detaName>view:first-child text:last-child {
		font-size: 35rpx;
	}

	.detaName>view:last-child {
		display: flex;
		justify-content: space-between;
	}

	.detaName>view:last-child>view {
		display: flex;
		align-items: center;
	}

	.detaName>view:last-child>view>view:first-child>text {
		color: #007AFF;
		font-size: 40rpx;
		font-weight: bold;
	}

	.detaName>view:last-child>view>view:last-child>text {
		font-size: 25rpx;
		color: #666666;
		text-decoration: line-through;
	}

	.detaName>view:last-child>view:last-child>text {
		background: #FEC400;
		height: 50rpx;
		text-align: center;
		line-height: 50rpx;
		color: #FFFFFF;
		border-radius: 10rpx;
	}

	.changgeType {
		display: flex;
		border-bottom: 1rpx solid #666666;
		border-top: 1rpx solid #666666;
	}

	.changgeType>view {
		flex: 1;
		text-align: center;
		height: 100rpx;
		line-height: 100rpx;
		font-size: 35rpx;
		color: #666666;
	}

	.border_bot {
		border-bottom: #000000 1rpx solid;
		color: black;
		font-weight: bolder;
	}

	.footer {
		display: flex;
		border: 1rpx solid #D8D8D8;
		position: fixed;
		bottom: 0;
		background: #FFFFFF;
		width: 750rpx;
		height: 130rpx;
	}

	.footer>view {
		flex: 1;
	}

	.footer>view:first-child {
		display: flex;
		justify-content: space-around;
		align-items: center;
		color: #A5A4A4;

	}

	.footer>view:first-child>view>view:first-child {
		text-align: center;
		font-size: 35rpx;
		margin-bottom: 10rpx;
	}

	.footer>view:last-child button {
		width: 100%;
		height: 100%;
		line-height: 130rpx;
		background: #007AFF;
		color: #FFFFFF;
	}
</style>
